package com.dak.robot.Service.Impl;

import com.dak.robot.Dao.ListenedDao;
import com.dak.robot.Service.ListenedService;
import net.mamoe.mirai.BotFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ListenedServiceImpl implements ListenedService {
    @Resource
    private ListenedDao listenedDao;

    @Override
    public int deleteUser(Long qqid) {
        return listenedDao.deleteByPrimaryKey(qqid);
    }

    @Override
    public int insertUser(Long qqid) {
        return listenedDao.insert(qqid);
    }

    @Override
    public Boolean checkInOrNotForUser(Long qqid) {
        return listenedDao.selectOne(qqid)>0;
    }

    @Override
    public List<Long> selectAllUser() {
        return listenedDao.selectAll();
    }
}
